%h3.page-title 我的项目
%p.light
  您所有有权限访问的项目都在这里, 但不包括公共项目, 除非你是公共项目的成员
%hr
.row
  .span3
    %ul.nav.nav-pills.nav-stacked
      = nav_tab :scope, nil do
        = link_to projects_dashboard_path do
          全部
          %span.pull-right
            = current_user.authorized_projects.count
      = nav_tab :scope, 'personal' do
        = link_to projects_dashboard_path(scope: 'personal') do
          个人
          %span.pull-right
            = current_user.personal_projects.count
      = nav_tab :scope, 'joined' do
        = link_to projects_dashboard_path(scope: 'joined') do
          参与
          %span.pull-right
            = current_user.authorized_projects.joined(current_user).count
      = nav_tab :scope, 'owned' do
        = link_to projects_dashboard_path(scope: 'owned') do
          拥有者
          %span.pull-right
            = current_user.owned_projects.count


    - if @groups.present?
      %fieldset
        %legend 项目组
        %ul.bordered-list
          - @groups.each do |group|
            %li{ class: (group.name == params[:group]) ? 'active' : 'light' }
              = link_to projects_dashboard_path(group: group.name) do
                %i.icon-folder-close-alt
                = group.name
                %small.pull-right
                  = group.projects.count



    - if @labels.present?
      %fieldset
        %legend 标签
        %ul.bordered-list
          - @labels.each do |label|
            %li{ class: (label.name == params[:label]) ? 'active' : 'light' }
              = link_to projects_dashboard_path(scope: params[:scope], label: label.name) do
                %i.icon-tag
                = label.name

  .span9
    %ul.bordered-list.my-projects.top-list
      - @projects.each do |project|
        %li
          %h4.project-title
            %span.access-icon
              - if project.public
                = public_icon
              - else
                = private_icon
            = link_to project_path(project), class: dom_class(project) do
              %strong= project.name_with_namespace

            - if project.forked_from_project
              %small.pull-right
                %i.icon-code-fork
                Forked from:
                = link_to project.forked_from_project.name_with_namespace, project_path(project.forked_from_project)
          .project-info
            .pull-right
              - project.labels.each do |label|
                %span.label.label-info
                  %i.icon-tag
                  = label.name
            - if project.description.present?
              %p= truncate project.description, length: 100
            .last-activity
              %span.light 最后活动:
              %span.date= project_last_activity(project)

        - if @projects.blank?
          %li
            %h3.nothing_here_message 这里没有项目哦.
    .bottom
      = paginate @projects, theme: "gitlab"

